#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>

int main (int argc, char *argv[]) {

	//  -D_FILE_OFFSET_BITS=64

	if (argv[1] == NULL){
		printf("need argument, example: lseeklargetfile /home/simon/700.temp/2.bin\n");
		exit(2); // echo $? 可以查看
	}
	char* filename = argv[1];
	int fd = open(filename, O_RDWR, O_APPEND);
	long long off_t = lseek(fd, 0L, SEEK_END);
	printf("size is %lld\n", off_t);
	close(fd);
	exit(0);
}
